import request from '@/utils/request';
import download from '@/utils/download'
import { CHECC_API_FAST_DFS } from '@/constants/proxy'
import { ObjectType } from 'typings/interfaces';

export function downloadFileRequest(fileId: string): Promise<any> {
  return download({
    url: CHECC_API_FAST_DFS + '/file/download',
    params: {
      fileId,
    },
  })
}

export function uploadFileRequest(fileId: string): Promise<any> {
  return download({
    url: CHECC_API_FAST_DFS + '/file/upload',
    params: {
      fileId,
    },
  })
}

export function deleteFileRequset(fileId: string): Promise<ObjectType> {
  return request({
    url: CHECC_API_FAST_DFS + '/file',
    method: 'delete',
    params: {
      fileId,
    }
  })
}

export function previewImageRequest(fileId: string) {
  return request({
    url: CHECC_API_FAST_DFS + '/file/path',
    method: 'get',
    params: {
      fileId,
    }
  })
}
